<template>
	<!-- 占位 -->
	<view style="position: fixed;" :style="{'bottom': bottom+'rpx'}">
		<u-tabbar iconSize="37" @change="change" active-color="#009943" inactive-color="#333333" :border-top="false"
			v-model="props.current" :list="parames.tabs"/>
	</view>
</template>
<script lang="ts" setup>
	import {
		reactive, onMounted, ref
	} from 'vue'
	import {

	} from '@dcloudio/uni-app'
	interface Props {
		current ?: number | string
	}
	const props = withDefaults(defineProps<Props>(), {
		current: 0
	})
	let bottom = ref(0)
	let parames = reactive({
		tabs: [
			{
				text: '首页',
				pagePath: "/pages/tabs/index",
				iconPath: "/static/tabBar/shouye.png",
				selectedIconPath: "/static/tabBar/shouye.png"
			},
			{
				text: '活动',
				pagePath: "/pages/tabs/activity",
				iconPath: "/static/tabBar/huodongyingxiao.png",
				selectedIconPath: "/static/tabBar/huodongyingxiao.png"
			},
			{
				text: '预定',
				pagePath: "/pages/tabs/schedule",
				iconPath: "/static/tabBar/yuding.png",
				selectedIconPath: "/static/tabBar/yuding.png"
			},
			{
				text: '我的',
				pagePath: "/pages/tabs/me",
				iconPath: "/static/tabBar/me.png",
				selectedIconPath: "/static/tabBar/me.png"
			}
		],
		index: 0
	})

	const change = (e : any) => {
		parames.index = e
	}
	onMounted(() => {
		uni.getSystemInfo({
			success(res) {
				bottom.value = res.safeArea.height - res.safeArea.bottom
			}
		})
	})
</script>

<style lang="scss" scoped>
</style>